import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

import wakeup.server.model.Track;


public class ClientMain {
	
	private final static Logger logger = Logger.getLogger("logger");

	public static void main(final String[] _args) throws UnknownHostException, IOException, ClassNotFoundException {	
		
		
		final Socket socket = new Socket("83.156.75.157", 22255);
		
        ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
        ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());

        logger.log(Level.INFO, "Envoi des information client au serveur");
//    	Client client = new Client();
//    	client.setPhoneId("Android_2.3:tom");
//    	oos.writeObject(client);
//    	oos.flush();
        
        Date date = new Date();
        System.out.println(date.toString());
        System.out.println(date.getDate());
        System.out.println(date.getMonth());
        System.out.println(date.getYear());
    	oos.writeObject(date);
    	oos.flush();

        Track track = (Track) ois.readObject();
        track.printTrack();
        
        
    	ois.close();
		oos.close();
        socket.close();
	}
}
